package integermap.main;

import java.util.Set;

/**
 * Map for storing pairs [int]=>[int] with good performance and low memory usage
 * @author alex
 */
public interface IntegerMap {
    /**
     * Put element with provided key
     * @param key the key
     * @param value the value of element
     * @return the value of old element
     * @throws IllegalArgumentException
     */
    Integer put(Integer key, Integer value);

    /**
     * Get element with provided key
     * @param key the key
     * @return the value of element
     */
    Integer get(Integer key);

    /**
     * Clears all elements
     */
    void clear();

    /**
     * Returns the count of elements
     * @return the count of elements
     */
    int size();

    /**
     * Returns the set of keys
     * @return the set of keys
     */
    Set keySet();
}
